<?php require_once ADMINVIEWPATH.'admin_header.php'; ?>
<?php require_once ADMINVIEWPATH.'admin_menu.php'; ?>
<!-- Page Content -->
            <div class="page-content">
                <!-- Page Breadcrumb -->
                <div class="page-breadcrumbs">
                    <ul class="breadcrumb">
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="/luckydog/index">首页</a>
                        </li>
                        <li>
                            <a href="#">新闻管理</a>
                        </li>
                        <li class="active"> 新闻试题管理 </li>
                    </ul>
                </div>
                <!-- Page Body -->
                <div class="page-body">
                    <div class="row">
                        <div class="col-xs-12 col-md-12">
                            <div class="widget">
                                <div class="widget-header ">
                                    <span class="widget-caption">新闻试题管理</span>
                                </div>
                                <div class="widget-body">
                                    <table class="table table-striped table-bordered table-hover" id="simpledatatable">
                                        <thead>
                                            <tr>
                                                <th>ID</th>
                                                <th>新闻标题</th>
                                                <th>选择题数量</th>
                                                <th>填空题数量</th>
                                                <th>图片题数量</th>
                                                <th>活动结束时间</th>
                                                <th>已答人数</th>
                                                <th>待审核数量</th>
                                                <th>已发积分</th>
                                                <th>已发金额/投入总金额</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <?php if(!empty($ruanwenList)):?>
                                                <?php foreach($ruanwenList as $key=> $row):?>
                                                    <tr class="gradeX" data_id = "<?=$row['newsID']?>">
                                                        <td class="center" style="text-align:center;width:20px;"><?= $row['newsID'];?></td>
                                                        <td class="center" style="text-align:center;width:120px;"><?= $row['title'];?></td>
                                                        <td questionType="1" class="center  js_view"><?= $row['danxuanCnt']?></td>
                                                        <td questionType="2" class="center js_view"><?= $row['tiankongCnt']?></td>
                                                        <td questionType="3" class="center js_view"><?= $row['tupianCnt']?></td>
                                                        
                                                        <td class="center"><?php echo $row['ispublish']?date("Y-m-d",$row['activity_endtime']):"未发布"?></td>
                                                        <td class="center"><?= $row['answeredUserCnt']?></td>
                                                        <td questionType="4" class="center js_view"><?= $row['daishenheCnt']?></td>
                                                        <td class="center"><?= $row['sendPoints']?></td>
                                                        <td class="center"><?= $row['sendMoney']?>/<?=$row['totalmoney']?></td>
                                                    </tr>
                                                <?php endforeach;?>
                                            <?php endif;?>
                                        </tr>
                                        <tr><td colspan="9"><div class="page_links"><?= $page_links?></div></td></tr>
                                        </tbody>

                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- /Page Body -->
            </div>
            <!-- /Page Content -->
<script src="<?= STATICURL; ?>js/jquery-2.0.3.min.js"></script>
<script src="<?= STATICURL; ?>layer/layer.js"></script>
<?php require_once ADMINVIEWPATH.'admin_footer.php'; ?>
<script>
     $('.js_view').on('click', function(){
        var id = $(this).parent().attr("data_id");
		var questionType = $(this).attr("questionType");
        layer.open({
            type: 2,
            title: "题目预览",
            shade: [0.5, '#000'],
            shadeClose: false,
            maxmin: true, //开启最大化最小化按钮
            area: ['550px', '480px'],
            content: '/luckydog/examination/ruanwenquestion?id='+id+'&questionType='+questionType
        });
    });

</script>


